#ifndef __MORSE_TRIANGLE_MESH_RENDERER__
#define __MORSE_TRIANGLE_MESH_RENDERER__

#include "primitiverenderer.h"
#include "trianglemesh.h"

class TriangleMeshRenderer : public PrimitiveRenderer {
public:
	TriangleMeshRenderer(STriangleMesh* primitive, 
							  const Vec3n& color);
	virtual void Init();
	virtual void Update();
	virtual void Render() const;
	virtual ~TriangleMeshRenderer();

	void UpdateFilledMesh();
	void UpdateWireFrameMesh();

	void SetNormalSign(nfloat sign) {normalsign = sign;}
	nfloat NormalSign() const {return normalsign;}
private:
	GLint list;
	GLint listWireframe;

	std::vector<STriangle*> element;
	std::string positionAttribute;
	
	Vec3n color;
	bool showWireFrame, showSolid;
	nfloat normalsign;
};

#endif //__MORSE_TRIANGLE_MESH_RENDERER__
